<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script>
	function id(name){
		return document.getElementById(name);
	}
	
	function tag(name,elem){
		return (elem||document).getElementsByTagName(name);
	}
	function domReady(f){
		if(domReady.done)
			return f();
		
		if(domReady.timer){
			domReady.ready.push(f);
		}else{
			window.addEventListener("load",isDomReady,false);
			//addEvent(window,"load",isDomReady);
			domReady.ready = [f];
			domReady.timer = setInterval(isDomReady,13);
		}
	}
	
	function isDomReady(){
		if(domReady.done) return false;
		if(document && document.getElementById && document.getElementsByTagName&&document.body){
			clearInterval(domReady.timer);
			domReady.timer= null;
			
			for(var i=0;i<domReady.ready.length;i++){
				domReady.ready[i]();
			}
			domReady.ready = null;
			domReady.done = true;
		}
	}
	
	domReady(function(){
		alert("the dom is loaded!");
		tag("h1")[0].style.border = "4px solid black";
		
	});
</script>
</head>
<body >
   <div style="margin-top:25px; text-align:center">
     <img id="seat0" src="" alt="" />
      <img id="seat1" src="" alt="" />
      <img id="seat2" src="" alt="" />
      <img id="seat3" src="" alt="" />
      <img id="seat4" src="" alt="" />
      <img id="seat5" src="" alt="" />
      <img id="seat6" src="" alt="" />
      <img id="seat7" src="" alt="" />
      <img id="seat8" src="" alt="" /><br />
      <img id="seat9" src="" alt="" />
      <img id="seat10" src="" alt="" />
      <img id="seat11" src="" alt="" />
      <img id="seat12" src="" alt="" />
      <img id="seat13" src="" alt="" />
      <img id="seat14" src="" alt="" />
      <img id="seat15" src="" alt="" />
      <img id="seat16" src="" alt="" />
      <img id="seat17" src="" alt="" /><br />
      <img id="seat18" src="" alt="" />
      <img id="seat19" src="" alt="" />
      <img id="seat20" src="" alt="" />
      <img id="seat21" src="" alt="" />
      <img id="seat22" src="" alt="" />
      <img id="seat23" src="" alt="" />
      <img id="seat24" src="" alt="" />
      <img id="seat25" src="" alt="" />
      <img id="seat26" src="" alt="" /><br />
      <img id="seat27" src="" alt="" />
      <img id="seat28" src="" alt="" />
      <img id="seat29" src="" alt="" />
      <img id="seat30" src="" alt="" />
      <img id="seat31" src="" alt="" />
      <img id="seat32" src="" alt="" />
      <img id="seat33" src="" alt="" />
      <img id="seat34" src="" alt="" />
      <img id="seat35" src="" alt="" /><br />
      <h1> dom load ok</h1>
      <input type="button" id="findseats" value="Find Seats" />
    </div>
  </body>
</html>